package com.kirk.cts.core.runcycle.schedule.processor.support;

import com.kirk.cts.core.dispose.DisposeServiceManager;
import com.kirk.cts.core.runcycle.schedule.Schedule;
import com.kirk.cts.core.runcycle.schedule.processor.IShutDownScheduleProcessor;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * <p> ShutDownScheduleProcessor.java </p>
 *
 * @version 1.0.0
 * @Author kirkliu
 * @Date 2020-08-30 16:36
 * @Description 停止运行执行任务
 */
@Component("shutDownScheduleProcessor")
public class ShutDownScheduleProcessor extends AbstractScheduleProcessor implements IShutDownScheduleProcessor {

    @Resource(name = "disposeServiceManager")
    private DisposeServiceManager disposeServiceManager;

    @Override
    public int getIndex() {
        return 3;
    }

    @Override
    protected void doExecute(Schedule schedule) {
        disposeServiceManager.run();
    }


    @Override
    protected boolean isNewThread() {
        return true;
    }

}
